﻿using System;
using System.Collections.Generic;
using MiniJSON;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUpdater;
using XUtliPoolLib;

namespace XMainClient.UI
{
	// Token: 0x020018BB RID: 6331
	internal class XLoginView : DlgBase<XLoginView, LoginWindowBehaviour>
	{
		// Token: 0x17003A3F RID: 14911
		// (get) Token: 0x060107EF RID: 67567 RVA: 0x0040AD24 File Offset: 0x00408F24
		public override string fileName
		{
			get
			{
				return "SelectChar/LoginDlg";
			}
		}

		// Token: 0x17003A40 RID: 14912
		// (get) Token: 0x060107F0 RID: 67568 RVA: 0x0040AD3C File Offset: 0x00408F3C
		public override int layer
		{
			get
			{
				return 1;
			}
		}

		// Token: 0x060107F1 RID: 67569 RVA: 0x0040AD4F File Offset: 0x00408F4F
		protected override void Init()
		{
			this._doc = XSingleton<XLoginDocument>.singleton;
			this._doc.View = this;
		}

		// Token: 0x060107F2 RID: 67570 RVA: 0x0040AD6C File Offset: 0x00408F6C
		protected override void OnShow()
		{
			base.OnShow();
			this.SetVersion("v" + XSingleton<XUpdater.XUpdater>.singleton.Version);
			base.uiBehaviour.m_Login.SetVisible(!this._doc.IsPublish());
			base.uiBehaviour.m_Account.SetVisible(!this._doc.IsPublish());
			base.uiBehaviour.m_Password.SetVisible(!this._doc.IsPublish());
			int num = 4;
			float num2 = 0f;
            //zcg 
//             float y = base.uiBehaviour.m_GuestLogin.gameObject.transform.localPosition.y;
// 			if (Application.platform == RuntimePlatform.IPhonePlayer)
// 			{
// 				num |= 1;
// 				num2 -= (float)(base.uiBehaviour.m_GuestLogin.spriteWidth / 2 + 10);
// 			}
// 			if (XSingleton<XUpdater.XUpdater>.singleton.XPlatform.CheckWeChatInstalled() || (Application.platform != RuntimePlatform.IPhonePlayer))
// 			{
// 				num |= 2;
// 				num2 -= (float)(base.uiBehaviour.m_GuestLogin.spriteWidth / 2 + 10);
// 			}
// 			if ((num & 1) > 0)
// 			{
// 				base.uiBehaviour.m_GuestLogin.gameObject.transform.localPosition = new Vector3(num2, y);
// 				num2 += (float)(base.uiBehaviour.m_GuestLogin.spriteWidth + 10);
// 			}
// 			else
// 			{
// 				base.uiBehaviour.m_GuestLogin.SetVisible(false);
// 			}
// 			if ((num & 2) > 0)
// 			{
// 				base.uiBehaviour.m_WXLogin.gameObject.transform.localPosition = new Vector3(num2, y);
// 				num2 += (float)(base.uiBehaviour.m_WXLogin.spriteWidth + 10);
// 			}
// 			else
// 			{
// 				base.uiBehaviour.m_WXLogin.SetVisible(false);
// 			}
// 			if ((num & 4) > 0)
// 			{
// 				base.uiBehaviour.m_QQLogin.gameObject.transform.localPosition = new Vector3(num2, y);
// 				num2 += (float)(base.uiBehaviour.m_QQLogin.spriteWidth + 10);
// 			}
// 			else
// 			{
// 				base.uiBehaviour.m_QQLogin.SetVisible(false);
// 			}
		}

		// Token: 0x060107F3 RID: 67571 RVA: 0x0040AFA8 File Offset: 0x004091A8
		public override void RegisterEvent()
		{
			base.uiBehaviour.m_Login.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnAccountInfoEnterClick));
            //zcg base.uiBehaviour.m_QQLogin.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnQQLoginButtonClick));
            //zcg base.uiBehaviour.m_WXLogin.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnWXLoginButtonClick));
            //zcg base.uiBehaviour.m_GuestLogin.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnGuestButtonClick));
            base.uiBehaviour.m_Notice.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnNoticeClicked));
			base.uiBehaviour.m_CG.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCGClicked));
			base.uiBehaviour.m_CustomerService.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnCustomerServiceClicked));
			base.uiBehaviour.m_EnterToSelectChar.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnEnterToSelectCharClicked));
			base.uiBehaviour.m_ReturnToLogin.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnReturnToLoginClicked));
			base.uiBehaviour.m_ServerListButton.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnSelectServerClick));
			base.uiBehaviour.m_CloseServerList.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnServerListCloseClicked));
			base.uiBehaviour.m_LeaveQueue.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnLeaveQueueClicked));
			base.uiBehaviour.m_FriendWrapContent.RegisterItemUpdateEventHandler(new WrapItemUpdateEventHandler(this.FriendWrapContentUpdated));
		}

		// Token: 0x060107F4 RID: 67572 RVA: 0x0040B130 File Offset: 0x00409330
		public void RefreshAccount()
		{
			base.uiBehaviour.m_Account.SetText(this._doc.Account ?? "");
			base.uiBehaviour.m_Password.SetText(this._doc.Password ?? "");
		}

		// Token: 0x060107F5 RID: 67573 RVA: 0x0040B188 File Offset: 0x00409388
		private bool OnAccountInfoEnterClick(IXUIButton button)
		{
			if (this._doc.CheckLoginBlockTime())
			{
				string text = base.uiBehaviour.m_Account.GetText();
				string text2 = base.uiBehaviour.m_Password.GetText();
				this._doc.Authorization(XAuthorizationChannel.XAuthorization_Internal, true, false, text, text2);
			}
			else
			{
				XSingleton<UiUtility>.singleton.ShowLoginTip(XStringDefineProxy.GetString("LOGIN_TOO_FREQUENT"));
			}
			return true;
		}

		// Token: 0x060107F6 RID: 67574 RVA: 0x0040B1F8 File Offset: 0x004093F8
		private bool OnQQLoginButtonClick(IXUIButton go)
		{
			if (this._doc.CheckLoginBlockTime())
			{
				this._doc.Authorization(XAuthorizationChannel.XAuthorization_QQ, true, false, null, null);
			}
			else
			{
				XSingleton<UiUtility>.singleton.ShowLoginTip(XStringDefineProxy.GetString("LOGIN_TOO_FREQUENT"));
			}
			return true;
		}

		// Token: 0x060107F7 RID: 67575 RVA: 0x0040B248 File Offset: 0x00409448
		private bool OnWXLoginButtonClick(IXUIButton go)
		{
			if (this._doc.CheckLoginBlockTime())
			{
				this._doc.Authorization(XAuthorizationChannel.XAuthorization_WeChat, true, false, null, null);
			}
			else
			{
				XSingleton<UiUtility>.singleton.ShowLoginTip(XStringDefineProxy.GetString("LOGIN_TOO_FREQUENT"));
			}
			return true;
		}

		// Token: 0x060107F8 RID: 67576 RVA: 0x0040B298 File Offset: 0x00409498
		private bool OnGuestButtonClick(IXUIButton go)
		{
			if (this._doc.CheckLoginBlockTime())
			{
				this._doc.Authorization(XAuthorizationChannel.XAuthorization_Guest, true, false, null, null);
			}
			else
			{
				XSingleton<UiUtility>.singleton.ShowLoginTip(XStringDefineProxy.GetString("LOGIN_TOO_FREQUENT"));
			}
			return true;
		}

		// Token: 0x060107F9 RID: 67577 RVA: 0x0040B2E8 File Offset: 0x004094E8
		private bool OnNoticeClicked(IXUIButton go)
		{
			XSingleton<UiUtility>.singleton.ShowAfterLoginAnnouncement(this._doc.Announcement);
			return true;
		}

		// Token: 0x060107FA RID: 67578 RVA: 0x0040B314 File Offset: 0x00409514
		private bool OnCGClicked(IXUIButton button)
		{
			//zcg XSingleton<XTimerMgr>.singleton.SetTimer(0.1f, new XTimerMgr.ElapsedEventHandler(XSingleton<XUpdater.XUpdater>.singleton.PlayCG), null);
			return true;
		}

		// Token: 0x060107FB RID: 67579 RVA: 0x0040B348 File Offset: 0x00409548
		private bool OnCustomerServiceClicked(IXUIButton go)
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			RuntimePlatform platform = Application.platform;
			if (platform != (RuntimePlatform)8)
			{
				if (platform != (RuntimePlatform)11)
				{
					XSingleton<XDebug>.singleton.AddGreenLog("CustomerService-Login", null, null, null, null, null);
				}
				else
				{
					dictionary["url"] = XSingleton<XGlobalConfig>.singleton.GetValue("CustomerServiceLoginAndroid");
					dictionary["screendir"] = "SENSOR";
					XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendExtDara("open_url", Json.Serialize(dictionary));
				}
			}
			else
			{
				dictionary["url"] = XSingleton<XGlobalConfig>.singleton.GetValue("CustomerServiceLoginApple");
				dictionary["screendir"] = "SENSOR";
				XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendExtDara("open_url", Json.Serialize(dictionary));
			}
			return true;
		}

		// Token: 0x060107FC RID: 67580 RVA: 0x0040B420 File Offset: 0x00409620
		private bool OnEnterToSelectCharClicked(IXUIButton go)
		{
			if (string.IsNullOrEmpty(XSingleton<XClientNetwork>.singleton.XLoginToken))
			{
				XSingleton<XLoginDocument>.singleton.AutoAuthorization(false);
			}
			else
			{
				XSingleton<XLoginDocument>.singleton.Login();
			}
			return true;
		}

		// Token: 0x060107FD RID: 67581 RVA: 0x0040B464 File Offset: 0x00409664
		private bool OnReturnToLoginClicked(IXUIButton go)
		{
			this._doc.AuthorizationSignOut();
			return true;
		}

		// Token: 0x060107FE RID: 67582 RVA: 0x0040B483 File Offset: 0x00409683
		private void OnServerListCloseClicked(IXUISprite sp)
		{
			base.uiBehaviour.m_ServerList.gameObject.SetActive(false);
		}

		// Token: 0x060107FF RID: 67583 RVA: 0x0040B4A0 File Offset: 0x004096A0
		private bool OnLeaveQueueClicked(IXUIButton button)
		{
			base.uiBehaviour.m_QueueFrame.SetActive(false);
			this._doc.CancelQueue();
			return true;
		}

		// Token: 0x06010800 RID: 67584 RVA: 0x0040B4D1 File Offset: 0x004096D1
		public void TweenAlpha(bool bForward)
		{
			base.uiBehaviour.m_Tween.PlayTween(bForward, -1f);
		}

		// Token: 0x06010801 RID: 67585 RVA: 0x0040B4EC File Offset: 0x004096EC
		public void SetVersion(string version)
		{
			if (XSingleton<XUpdater.XUpdater>.singleton.XPlatform.IsTestMode())
			{
				base.uiBehaviour.m_Version.SetText(version + "Test");
			}
			else
			{
				base.uiBehaviour.m_Version.SetText(version);
			}
		}

		// Token: 0x06010802 RID: 67586 RVA: 0x0040B541 File Offset: 0x00409741
		public void ShowLogin()
		{
			base.uiBehaviour.m_normalFrame.SetActive(true);
			base.uiBehaviour.m_ServerListFrame.SetActive(false);
			base.uiBehaviour.m_QueueFrame.SetActive(false);
			this.RefreshAccount();
		}

		// Token: 0x06010803 RID: 67587 RVA: 0x0040B584 File Offset: 0x00409784
		public void ShowSelectServer()
		{
			base.uiBehaviour.m_normalFrame.SetActive(false);
			base.uiBehaviour.m_ServerListFrame.SetActive(true);
			base.uiBehaviour.m_ServerList.gameObject.SetActive(false);
			base.uiBehaviour.m_QueueFrame.SetActive(false);
		}

		// Token: 0x06010804 RID: 67588 RVA: 0x0040B5E0 File Offset: 0x004097E0
		public void ShowQueue()
		{
			base.uiBehaviour.m_normalFrame.SetActive(false);
			base.uiBehaviour.m_ServerListFrame.SetActive(false);
			base.uiBehaviour.m_QueueFrame.SetActive(true);
			base.uiBehaviour.m_QueueTip.SetText("");
		}

		// Token: 0x06010805 RID: 67589 RVA: 0x0040B63C File Offset: 0x0040983C
		public void RefreshQueueState()
		{
			if (base.uiBehaviour.m_QueueFrame.activeSelf)
			{
				base.uiBehaviour.m_QueueTip.SetText(string.Format(XSingleton<UiUtility>.singleton.ReplaceReturn(XStringDefineProxy.GetString("WAIT_FOR_SERVER_QUEUE")), XSingleton<XClientNetwork>.singleton.Server, this._doc.RoleCountInQueue, XSingleton<UiUtility>.singleton.TimeAccFormatString((int)this._doc.LeftTimeInQueue, 3, 0)));
			}
		}

		// Token: 0x06010806 RID: 67590 RVA: 0x0040B6BE File Offset: 0x004098BE
		public void OnShowServerList()
		{
			base.uiBehaviour.m_ServerPool.ReturnAll(false);
			base.uiBehaviour.m_ServerList.gameObject.SetActive(true);
			this.SetupAreaServerList();
		}

		// Token: 0x06010807 RID: 67591 RVA: 0x0040B6F1 File Offset: 0x004098F1
		private void OnSelectServerClick(IXUISprite sp)
		{
			this.OnShowServerList();
		}

		// Token: 0x06010808 RID: 67592 RVA: 0x0040B6FB File Offset: 0x004098FB
		public void SetCurrentServer()
		{
			base.uiBehaviour.m_CurrentServer.SetText(XSingleton<XClientNetwork>.singleton.Server);
		}

		// Token: 0x06010809 RID: 67593 RVA: 0x0040B71C File Offset: 0x0040991C
		private void SetupAreaServerList()
		{
			base.uiBehaviour.m_AreaPool.ReturnAll(false);
			Vector3 localPosition = base.uiBehaviour.m_AreaPool._tpl.transform.localPosition;
			int tplHeight = base.uiBehaviour.m_AreaPool.TplHeight;
			IXUICheckBox ixuicheckBox = null;
			string @string = XSingleton<XStringTable>.singleton.GetString("BACK_SERVERS");
			bool flag = XSingleton<XLoginDocument>.singleton.BackFlowServerList.Count > 0;
			for (int i = 0; i < this._doc.ZoneList.Count; i++)
			{
				GameObject gameObject = base.uiBehaviour.m_AreaPool.FetchGameObject(false);
				gameObject.name = "Area" + i;
				gameObject.transform.localPosition = localPosition + new Vector3(0f, (float)(-(float)i * tplHeight));
				IXUILabel ixuilabel = gameObject.GetComponent("XUILabel") as IXUILabel;
				IXUILabel ixuilabel2 = gameObject.transform.Find("Selected/Label").GetComponent("XUILabel") as IXUILabel;
				ixuilabel2.SetText(this._doc.ZoneList[i]);
				ixuilabel.SetText(this._doc.ZoneList[i]);
				ixuilabel.RegisterLabelClickEventHandler(new LabelClickEventHandler(this.OnAreaClicked));
				string a = this._doc.ZoneList[i];
				if (flag && a == @string)
				{
					flag = true;
					this.ShowAreaServers(this._doc.ZoneList[i]);
					ixuicheckBox = (gameObject.GetComponent("XUICheckBox") as IXUICheckBox);
				}
				if (i == 2 && !flag)
				{
					this.ShowAreaServers(this._doc.ZoneList[i]);
					ixuicheckBox = (gameObject.GetComponent("XUICheckBox") as IXUICheckBox);
				}
			}
			if (ixuicheckBox != null)
			{
				ixuicheckBox.bChecked = true;
			}
		}

		// Token: 0x0601080A RID: 67594 RVA: 0x0040B934 File Offset: 0x00409B34
		private void ShowAreaServers(string zone)
		{
			if (zone == XStringDefineProxy.GetString("FRIENDS_SERVERS"))
			{
				base.uiBehaviour.m_FriendFrame.gameObject.SetActive(true);
				base.uiBehaviour.m_ServerFrame.gameObject.SetActive(false);
				base.uiBehaviour.m_FriendWrapContent.SetContentCount(this._doc.FriendOpenid.Count, true);
				base.uiBehaviour.m_FriendScrollView.ResetPosition();
			}
			else
			{
				base.uiBehaviour.m_FriendFrame.gameObject.SetActive(false);
				base.uiBehaviour.m_ServerFrame.gameObject.SetActive(true);
				base.uiBehaviour.m_FriendWrapContent.SetContentCount(0, true);
			}
			base.uiBehaviour.m_ServerPool.ReturnAll(false);
			Vector3 localPosition = base.uiBehaviour.m_ServerPool._tpl.transform.localPosition;
			int tplHeight = base.uiBehaviour.m_ServerPool.TplHeight;
			int tplWidth = base.uiBehaviour.m_ServerPool.TplWidth;
			List<int> list = this._doc.ServerCategory[zone];
			int num = 0;
			for (int i = list.Count - 1; i >= 0; i--)
			{
				ServerInfo serverData = this._doc.GetServerData(list[i]);
				if (serverData != null)
				{
					if (!XSingleton<XGame>.singleton.IsGMAccount)
					{
						if (serverData.StateTxt == 6)
						{
							goto IL_2EF;
						}
					}
					Transform transform = base.uiBehaviour.m_ServerPool.FetchGameObject(true).transform;
					transform.name = "Server" + list[i];
					int num2 = num / 2;
					int num3 = num % 2;
					num++;
					transform.localPosition = localPosition + new Vector3((float)(num3 * tplWidth), (float)(-(float)num2 * tplHeight));
					IXUISprite ixuisprite = transform.GetComponent("XUISprite") as IXUISprite;
					IXUILabel ixuilabel = transform.Find("Bg/Name").GetComponent("XUILabel") as IXUILabel;
					ixuisprite.ID = (ulong)((long)list[i]);
					ixuilabel.SetText(serverData.ServerName);
					ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnServerClicked));
					IXUISprite ixuisprite2 = transform.Find("Bg/Status").GetComponent("XUISprite") as IXUISprite;
					ixuisprite2.SetSprite(this._ServerStateString((ServerStateEnum)serverData.State));
					this._SetServerStateLabel(transform.gameObject, serverData.StateTxt);
					IXUILabel ixuilabel2 = transform.Find("Bg/Level").GetComponent("XUILabel") as IXUILabel;
					ixuilabel2.Alpha = ((serverData.Level == 0U) ? 0f : 1f);
					ixuilabel2.SetText(string.Format("Lv.{0}", serverData.Level));
				}
				IL_2EF:;
			}
			base.uiBehaviour.m_ServerScrollView.ResetPosition();
		}

		// Token: 0x0601080B RID: 67595 RVA: 0x0040BC58 File Offset: 0x00409E58
		private void FriendWrapContentUpdated(Transform t, int index)
		{
			if (index < 0 || index >= this._doc.FriendOpenid.Count)
			{
				t.gameObject.SetActive(false);
			}
			else
			{
				FriendServerInfo friendServerInfo = null;
				if (this._doc.FriendServerDic.TryGetValue(this._doc.FriendOpenid[index], out friendServerInfo))
				{
					ServerInfo serverData = this._doc.GetServerData(this._doc.FriendServerDic[this._doc.FriendOpenid[index]].info.serverid);
					if (serverData != null)
					{
						IXUISprite ixuisprite = t.GetComponent("XUISprite") as IXUISprite;
						IXUILabel ixuilabel = t.Find("Bg/Name").GetComponent("XUILabel") as IXUILabel;
						ixuisprite.ID = (ulong)((long)friendServerInfo.info.serverid);
						ixuilabel.SetText(serverData.ServerName);
						ixuisprite.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnServerClicked));
						IXUISprite ixuisprite2 = t.Find("Bg/Status").GetComponent("XUISprite") as IXUISprite;
						ixuisprite2.SetSprite(this._ServerStateString((ServerStateEnum)serverData.State));
						this._SetServerStateLabel(t.gameObject, serverData.StateTxt);
						IXUILabel ixuilabel2 = t.Find("Bg/Level").GetComponent("XUILabel") as IXUILabel;
						ixuilabel2.Alpha = ((friendServerInfo.info.level == 0) ? 0f : 1f);
						ixuilabel2.SetText(string.Format("Lv.{0}", friendServerInfo.info.level));
						IXUILabel ixuilabel3 = t.Find("Bg/GameName").GetComponent("XUILabel") as IXUILabel;
						ixuilabel3.SetText(friendServerInfo.info.rolename);
						IXUILabel ixuilabel4 = t.Find("Bg/IMName").GetComponent("XUILabel") as IXUILabel;
						ixuilabel4.SetText(friendServerInfo.account);
						IXUITexture ixuitexture = t.Find("Bg/Icon").GetComponent("XUITexture") as IXUITexture;
						ixuitexture.SetVisible(true);
						ixuitexture.SetTexturePath("");
						XSingleton<XUICacheImage>.singleton.Load(friendServerInfo.icon, ixuitexture, base.uiBehaviour);
					}
				}
			}
		}

		// Token: 0x0601080C RID: 67596 RVA: 0x0040BEBC File Offset: 0x0040A0BC
		private void OnAreaClicked(IXUILabel sp)
		{
			this.ShowAreaServers(sp.GetText());
		}

		// Token: 0x0601080D RID: 67597 RVA: 0x0040BECC File Offset: 0x0040A0CC
		private void OnServerClicked(IXUISprite sp)
		{
			base.uiBehaviour.m_ServerList.gameObject.SetActive(false);
			this._doc.OnServerChanged((int)sp.ID);
		}

		// Token: 0x0601080E RID: 67598 RVA: 0x0040BEFC File Offset: 0x0040A0FC
		private Color _ServerStateColor(ServerStateEnum state)
		{
			Color result;
			switch (state)
			{
			case ServerStateEnum.TIMEOUT:
				result = new Color(1f, 1f, 1f, 1f);
				break;
			case ServerStateEnum.EMPTY:
				result = new Color(0.1254902f, 0.8784314f, 0.16078432f, 1f);
				break;
			case ServerStateEnum.NORMAL:
				result = new Color(0.99607843f, 0.7254902f, 0f, 1f);
				break;
			case ServerStateEnum.FULL:
				result = new Color(0.8784314f, 0.28627452f, 0.1254902f, 1f);
				break;
			default:
				result = new Color(1f, 1f, 1f, 1f);
				break;
			}
			return result;
		}

		// Token: 0x0601080F RID: 67599 RVA: 0x0040BFB4 File Offset: 0x0040A1B4
		private string _ServerStateString(ServerStateEnum state)
		{
			string result;
			switch (state)
			{
			case ServerStateEnum.TIMEOUT:
				result = "fwq_0";
				break;
			case ServerStateEnum.EMPTY:
				result = "fwq_1";
				break;
			case ServerStateEnum.NORMAL:
				result = "fwq_2";
				break;
			case ServerStateEnum.FULL:
				result = "fwq_3";
				break;
			default:
				result = "fwq_0";
				break;
			}
			return result;
		}

		// Token: 0x06010810 RID: 67600 RVA: 0x0040C008 File Offset: 0x0040A208
		private void _SetServerStateLabel(GameObject go, int state)
		{
			int num = XFastEnumIntEqualityComparer<ServerFlagEnum>.ToInt(ServerFlagEnum.MAX);
			for (int i = 0; i < num; i++)
			{
				Transform transform = go.transform.Find(string.Format("Bg/State{0}", i));
				if (transform != null)
				{
					transform.gameObject.SetActive(state == i);
				}
			}
		}

		// Token: 0x04007772 RID: 30578
		private XLoginDocument _doc = null;
	}
}
